//
//  UserCenterHelper.m
//  MengCP
//
//  Created by Gideon on 16/4/27.
//  Copyright © 2016年 LiZhenning. All rights reserved.
//

#import "UserCenterHelper.h"


@implementation UserCenterHelper

+ (UserCenterHelper *)shareInstance
{
    static UserCenterHelper *instance = nil;
    static dispatch_once_t once;
    
    dispatch_once(&once, ^{
        
        instance = [[UserCenterHelper alloc] init];
        
    });
    
    return instance;
}

# pragma mark -- 检查网络
+ (BOOL)checkNetWork {
    
    Reachability *reachability   = [Reachability reachabilityWithHostName:@"www.apple.com"];
    NetworkStatus internetStatus = [reachability currentReachabilityStatus];
    NSString *net = @"notReachable";
    switch (internetStatus) {
            
        case ReachableViaWiFi:
            net = @"wifi";
            break;
            
        case ReachableViaWWAN:
            net = @"wwan";
            break;
            
        case NotReachable:
            net = @"notReachable";
            
        default:
            break;
    }
    
    BOOL isNetWork = [net isEqualToString:@"notReachable"];
    
    return isNetWork;
}



@end
